package kr.re.etri.snsenabler.shared;

import java.io.Serializable;
import java.util.ArrayList;

public class ServiceResponse implements Serializable {
	private boolean succeeded;
	private String errorMessage;
	private Data data;
	private ArrayList<Data> dataList;

	public ServiceResponse() {
		super();
	}

	public ServiceResponse(boolean succeeded) {
		super();
		this.succeeded = succeeded;
	}

	public ServiceResponse(String errorMessage) {
		super();
		this.errorMessage = errorMessage;
		this.succeeded = false;
	}

	public ServiceResponse(Data data) {
		super();
		this.data = data;
		this.succeeded = true;
	}

	public ServiceResponse(ArrayList<Data> dataList) {
		super();
		this.dataList = dataList;
		this.succeeded = true;
	}

	public boolean isFailed() {
		return !succeeded;
	}

	public boolean isSucceeded() {
		return succeeded;
	}

	public void setSucceeded(boolean succeeded) {
		this.succeeded = succeeded;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public Data getData() {
		return data;
	}

	public void setData(Data data) {
		this.data = data;
		this.succeeded = true;
	}

	public ArrayList<Data> getDataList() {
		return dataList;
	}

	public void setDataList(ArrayList<Data> dataList) {
		this.dataList = dataList;
		this.succeeded = true;
	}
}
